﻿<me:PDCBase x:Class="WPFExcelReport.XSGB11"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport"              
                   Background="White"  
                   x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:PDCBase.Resources>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/> 
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <CollectionViewSource   x:Key="vwGB11" Source="{Binding Path=SetData.ICC_GB1109}" />
    </me:PDCBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <WrapPanel >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock FontSize="18" Grid.Column="0" Text="目标重量:"></TextBlock>
                    <TextBox Background="Yellow" Grid.Column="1" Foreground="Red"  FontSize="18" Text="{Binding TARGETQTY}" Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" FontSize="18"  Content="全部" Click="btnConvert_Click"/>
                    <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0" Click="btnConvert_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Convert.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" FontSize="18"  Content="同纺批" Click="btnConvertBySpinLot_Click"/>
                    <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0" Click="btnConvertBySpinLot_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Convert.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Width="562">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="102"></ColumnDefinition>
                        <ColumnDefinition Width="30*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="16" Text="打包方式:" VerticalAlignment="Center" HorizontalAlignment="Left" Width="70"></TextBlock>
                    <TextBox Background="Yellow" Grid.Column="1" Name="txtGLBEM" FontSize="16" Text="" MaxLength="40" Width="150" Margin="0,0,0,0" />
                    <TextBlock Grid.Column="2" VerticalAlignment="Center" FontSize="16" Text="纱型纱支:" Width="70"></TextBlock>
                    <TextBox Background="Yellow" Grid.Column="3" Name="txtFBPART" FontSize="16" MaxLength="10" Width="100" Text="" />
                    <TextBlock Grid.Column="4" VerticalAlignment="Center" FontSize="16" Text="包数:" Width="40"></TextBlock>
                    <TextBlock Background="White" Name="TXT" VerticalAlignment="Center" Grid.Column="5" FontSize="16" Text="{Binding BoxNum,ElementName=TV}" />
                </Grid>
            </WrapPanel>
            <WrapPanel Visibility="{Binding IsMaster, Converter={StaticResource ResourceKey=bv}}" >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" FontSize="18"  Content="留位" Click="btnAllocateToVKP_Click"/>
                    <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0" Click="btnAllocateToVKP_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" FontSize="18"  Content="取消" Click="btnRemoveByVKP_Click"/>
                    <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0" Click="btnRemoveByVKP_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Backward.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <me:XSGZ18 x:Name="vwXSGZ18"/>
            </WrapPanel>            
        </StackPanel>
        <DataGrid  Grid.Row="1"  VerticalAlignment="Top"  
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column"     
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwGB11}}"  
                                   x:Name="dlgVKP"  
                                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="2" Margin="0,0.2,0.2,0"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=JP05, Converter={StaticResource ResourceKey=Trim}}" Header="留位"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GLLBEHI, Converter={StaticResource ResourceKey=pnum}}" Header="ID"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GPSPPART}" Header="纺批"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GPFBPART}" Header="纱型"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GLBSTKG, Converter={StaticResource ResourceKey=d1000}}" Header="KG"  Width="Auto" />
                <DataGridTextColumn Foreground="Red" Binding="{Binding Path=TARGETQTY,  Converter={StaticResource ResourceKey=d1000}}" Header="目标KG"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP10, Converter={StaticResource ResourceKey=gb2312}}" Header="包装" MaxWidth="120" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP04, Converter={StaticResource ResourceKey=Trim}}" Header="销售单"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CHGDATE}" Header="转换日期"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GPGART, Converter={StaticResource ResourceKey=Trim}}" Header="纱线"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GPGFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="色号"  Width="Auto" />
                
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:PDCBase>